package com.sistemas.mse.controlador.holamundo;

import java.text.DateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.sistemas.mse.HomeController;
import com.sistemas.mse.servicio.holamunudo.ProductManager;
import com.sistemas.mse.servicio.holamunudo.ProductService;


@Controller
public class InventoryController {

	private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
	
	
	@Autowired	
	private ProductService productManager;

@RequestMapping(value = "/inventory", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
   	String now = (new Date()).toString();
    logger.info("Returning hello view with " + now);

    model.addAttribute("now",now);
    model.addAttribute("products",productManager.getLst());
	return "products";
}




public void setProductoManager(ProductService productManager) {
	this.productManager = productManager;
}

}
